Only count visible children during size request
authorMatthias Clasen <mclasen@redhat.com>
Sun, 6 Mar 2011 04:25:35 +0000 (23:25 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Sun, 6 Mar 2011 04:27:26 +0000 (23:27 -0500)
This was causing spacing between image and label to be requested
in buttons, even though the image is invisible.

gtk/gtkbox.c

index 1ff75ebb335aa9b40f0b3c532894de48197e066a..f508173430a689dcd236ffe0c5b18c603bbe7a58 100644 (file)
@@ -1164,7 +1164,7 @@ gtk_box_compute_size_for_orientation (GtkBox *box,
   gint           largest_child = 0, largest_natural = 0;
 
   for (children = private->children; children != NULL;
-       children = children->next, nvis_children++)
+       children = children->next)
     {
       GtkBoxChild *child = children->data;
 
@@ -1190,6 +1190,8 @@ gtk_box_compute_size_for_orientation (GtkBox *box,
 
          required_size    += child_size;
          required_natural += child_natural;
+
+          nvis_children += 1;
         }
     }